package com.g4.shoppingsingle.controller;


import com.g4.shoppingsingle.model.DdSubOrderInfo;
import com.g4.shoppingsingle.service.IDdSubOrderInfoService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 订单明细表 前端控制器
 * </p>
 *
 * @author admin
 * @since 2021-10-27
 */
@Slf4j
@RestController
@RequestMapping("/shoppingsingle/ddSubOrderInfo")
public class DdSubOrderInfoController {
    @Autowired
    private IDdSubOrderInfoService ddSubOrderInfoService;
    @GetMapping("/subOrder/{userId}")
    public List<DdSubOrderInfo> getSubOrder(@PathVariable Integer userId){
        log.info("接收到了请求:"+userId);
        List<DdSubOrderInfo> subOrder=ddSubOrderInfoService.getSubOrder(userId);
        System.out.println("我的详细订单:"+subOrder);

        return subOrder;
    }

}
